<?php
	include 'database/Database.php';
	include 'database/User.php';
	
	class GcBabDatabase
	{
		private static $singleton;
		private $adminInof;		  
    	public static function getInstance()
    	{  
	        if(!isset(GcBabDatabase::$singleton))	        
	        	GcBabDatabase::$singleton = new GcMySqlDatabase('');
	        
	        return GcBabDatabase::$singleton;
    	}
    	
    	protected function connectionAdmin()
    	{
       		unset($adminInfo);
    	}
    	
		public function isExistBabDatabase()
    	{
    		$userInof = new GcAdmin();
       		$userInfo->serverAddress = "localhost";
       		$userInof->name = "root";
       		$userInof->password = "apmsetup";
       		$userInof->databaseName = "babServer";
       		
       		if( is_null( $this->singleton->openConnection($userInof) ) )
       		{       		
       			die("conection Bab Database failed" );
       			return false;
       		}
       		
       		if( $this->singleton->selectDatabase("babServer") == false )
       		{
       			$this->singleton->closeConnection();
       			return false;
       		}

       		$this->singleton->closeConnection();
    	}
	}
?>